Tit for tat is giving back as much as you got, especially in retaliation for something harmful. If you conk your sister in the head and she conks you right back, that’s tit for tat. And stop it.
Tit for tat is really more like “blow for a blow.” If you give someone a cupcake and she gives you one back, that’s not tit for tat, that’s just sweet. Tit for tat is meaner — it’s when someone does something like hit or steal something from someone, and the other person does something equally nasty back. This phrase is related to the saying "Let the punishment fit the crime."